﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="GestionActivos.aspx.cs" Inherits="API_CIC.Activos.GestionActivos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .style3
    {
        width: 104px;
    }
        .style6
        {
            width: 319px;
        }
        .style7
        {
            width: 343px;
        }
        .style8
        {
            width: 325px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    &nbsp;<center><h1>Gestión de Activos</h1></center>
    <table style="width:100%;">
        <tr>
            <td class="style3" valign="top">
                <asp:Menu ID="Menu1" runat="server" BackColor="#B5C7DE" 
                    DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em" 
                    ForeColor="#284E98" StaticSubMenuIndent="10px" 
                    onmenuitemclick="Menu1_MenuItemClick">
                    <DynamicHoverStyle BackColor="#284E98" ForeColor="White" />
                    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                    <DynamicMenuStyle BackColor="#B5C7DE" />
                    <DynamicSelectedStyle BackColor="#507CD1" />
                    <Items>
                        <asp:MenuItem Text="Consultar Activos" Value="1" Selected="True">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Ingresar Activo" Value="0"></asp:MenuItem>
                    </Items>
                    <StaticHoverStyle BackColor="#284E98" ForeColor="White" />
                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                    <StaticSelectedStyle BackColor="#507CD1" />
                </asp:Menu>
               
            </td>
            <td>
                 <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="1">
                     <asp:View ID="ViewIngresar" runat="server">
                         <center>
                             <h3>
                                 Ingresar un Nuevo Activo</h3>
                             <p>
                                 &nbsp;</p>
                         </center>
                        <asp:Panel ID="Panel1" runat="server" Width="824px" Height="343px">
                            
                            <table style="width:100%; height: 108px;">
                                <tr>
                                    <td class="style7" align="right">
                                        &nbsp;Nombre de Activo:
                                        <asp:TextBox ID="txtNombre" runat="server" Width="196px"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                            ControlToValidate="txtNombre" ErrorMessage="Campo Requerido" ForeColor="Red" 
                                            ValidationGroup="1">*</asp:RequiredFieldValidator>
                                    </td>
                                    <td class="style6">
                                        Descripción:<br /> &nbsp;<asp:TextBox ID="txtDescripcion" runat="server" Height="63px" 
                                            Width="296px" TextMode="MultiLine"></asp:TextBox>
                                    </td>
                                    <td>
                                        &nbsp;Cantidad:
                                        <asp:TextBox ID="txtCantidadIngresar" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                            ControlToValidate="txtCantidadIngresar" ErrorMessage="Campo Requerido" 
                                            ForeColor="Red" ValidationGroup="1">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator2" runat="server" 
                                            ControlToValidate="txtCantidadIngresar" ErrorMessage="Sólo números" 
                                            ForeColor="Red" ValidationGroup="1" MaximumValue="999999" MinimumValue="1" 
                                            Type="Integer"></asp:RangeValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style7" align="right">
                                    
                                        Marca:
                                        <asp:TextBox ID="txtMarca" runat="server" Width="194px" 
                                            style="margin-left: 0px"></asp:TextBox>
                                        
                                    </td>
                                    <td class="style6">
                                        &nbsp;Código: 
                                        <asp:TextBox ID="txtCodigo" runat="server" Width="122px"></asp:TextBox>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                  
                            </table>
                            
                            &nbsp;<table style="width:100%;">
                                <tr>
                                    <td align="center" class="style8">
                                        Fecha Ingreso:<asp:Calendar ID="Calendario" runat="server"></asp:Calendar>
                                    </td>
                                    <td align="center" valign="bottom">
                                        <asp:Button ID="btnIngresar" runat="server" Text="Ingresar" 
                                            onclick="btnIngresar_Click" ValidationGroup="1" />
                                    </td>
                                </tr>
                                
                            </table>
                         </asp:Panel>
                     </asp:View>
                     <asp:View ID="ViewAdministrar" runat="server">
                         <center>
                             <h3>
                                 Consultar activos</h3>
                         </center>
                         <asp:Panel ID="Panel3" runat="server">
                            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                 AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                 DataKeyNames="ID_ACTIVO" DataSourceID="LinqDataSource1" ForeColor="#333333" 
                                 GridLines="None">
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                <Columns>
                                    <asp:CommandField ShowSelectButton="True" SelectText="Seleccionar" 
                                        ButtonType="Image" SelectImageUrl="~/images/arrow_right_pagging.gif" />
                                    <asp:BoundField DataField="ID_ACTIVO" HeaderText="Id" ReadOnly="True" 
                                        SortExpression="ID_ACTIVO" />
                                    <asp:BoundField DataField="COD_ACTIVO" HeaderText="Código" 
                                        SortExpression="COD_ACTIVO" />
                                    <asp:BoundField DataField="NOM_ACTIVO" HeaderText="Nombre" 
                                        SortExpression="NOM_ACTIVO" />
                                    <asp:BoundField DataField="TXT_MARCA" HeaderText="Marca" 
                                        SortExpression="TXT_MARCA" />
                                    <asp:BoundField DataField="CAN_ACTIVO" HeaderText="Cantidad" 
                                        SortExpression="CAN_ACTIVO" />
                                         <asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="Elimina" runat="server" CausesValidation="False" 
                                            CommandName="Delete" 
                                            OnClientClick="return confirm(&quot;¿Desea eliminar este activo?&quot;);" 
                                            Text="Eliminar" />
                                    </ItemTemplate>
                                    <ControlStyle ForeColor="#CC0000" />
                                </asp:TemplateField>
                                </Columns>
                                <EditRowStyle BackColor="#999999" />
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                             </asp:GridView>
                             <asp:Button ID="btnModificar" runat="server" onclick="btnModificar_Click" 
                                 Text="Modificar" />
                             <br />
                             <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                                 ContextTypeName="API_CIC.LinqClasesDataContext" EntityTypeName="" 
                                 TableName="SGAPFACTIVOs" EnableDelete="True" EnableUpdate="True">
                             </asp:LinqDataSource>
                         </asp:Panel>

                     </asp:View>
                     <asp:View ID="ViewModificar" runat="server">
                     <center><h3>Modificar Activo</h3></center>
                     <asp:Panel ID="Panel2" runat="server" Width="824px" Height="343px">
                            
                            <table style="width:100%; height: 108px;">
                                <tr>
                                    <td class="style7" align="right">
                                        &nbsp;Nombre de Activo: <asp:TextBox ID="txtNombreModificar" runat="server" 
                                            Width="196px"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                            ControlToValidate="txtNombreModificar" ErrorMessage="Campo Requerido" 
                                            ForeColor="Red" ValidationGroup="2">*</asp:RequiredFieldValidator>
                                    </td>
                                    <td class="style6">
                                        Descripción:<br /> &nbsp;<asp:TextBox ID="txtDescripcionModificar" 
                                            runat="server" Height="63px" 
                                            Width="296px" TextMode="MultiLine"></asp:TextBox>
                                    </td>
                                    <td>
                                        &nbsp;Cantidad:
                                        <asp:TextBox ID="txtCantidadModificar" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                                            ControlToValidate="txtCantidadModificar" ErrorMessage="Campo Requerido" 
                                            ForeColor="Red" ValidationGroup="2">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                            ControlToValidate="txtCantidadModificar" ErrorMessage="Sólo números" 
                                            ForeColor="Red" ValidationGroup="2" MaximumValue="99999" MinimumValue="1" 
                                            Type="Integer"></asp:RangeValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style7" align="right">
                                    
                                        Marca:
                                        <asp:TextBox ID="txtMarcaModificar" runat="server" Width="194px" 
                                            style="margin-left: 0px"></asp:TextBox>
                                        
                                    </td>
                                    <td class="style6">
                                        &nbsp;Código: 
                                        <asp:TextBox ID="txtCodigoModificar" runat="server" Width="126px"></asp:TextBox>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                  
                            </table>
                            
                            &nbsp;<table style="width:100%;">
                                <tr>
                                    <td align="center" class="style8">
                                        Fecha Ingreso:<asp:Calendar ID="CalendarioModificar" runat="server"></asp:Calendar>
                                    </td>
                                    <td align="center" valign="bottom">
                                        <asp:Button ID="btnGuardar" runat="server" Text="Guardar" 
                                            onclick="btnGuardar_Click" ValidationGroup="2" />
                                    </td>
                                </tr>
                                
                            </table>
                         </asp:Panel>
                     </asp:View>
                </asp:MultiView></td>
        </tr>
        <tr>
            <td class="style3" valign="top">
                &nbsp;</td>
            <td>
                 &nbsp;</td>
        </tr>
    </table>
</asp:Content>
